def maxP() :
	maxSolutions = 0
	maxI = 0
	for i in range(3, 1001) :
		s = numSolutions(i)
		if s > maxSolutions :
			maxI = i
			maxSolutions = s
	return (maxI, maxSolutions)

def numSolutions(n) :
	s = 0
	print "n: %i" % n
	for a in range(1, n-1) :
		for b in range(a, n-a) :
			c = n - a - b
			#print "  %i^2 + %i^2 ?= %i^2" % (a, b, c)
			if isRight(a, b, c) :
				print "  %i^2 + %i^2 = %i^2" % (a, b, c)
				s += 1
	print "s: %i\n" % s
	return s

def isRight(a, b, c) :
	if a*a + b*b == c*c : return True
	return False

print "maxI: %i, maxS: %i" % maxP()

# test change